package main

import (
	"bufio"
	"os"
	"fmt"
)

func main()  {
	counts:=make(map[string]int)
	input:=bufio.NewScanner(os.Stdin)
	for input.Scan(){
		counts[input.Text()]++;
	}
	for key,value:=range counts{
		if value>1{
			fmt.Printf("%s:%d", key, value)
		}
	}
}